﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SXICE.Core.Models;
using SXICE.IService;
using SXICE.IService.Models;
using SXICE.WebAPI.Utilities;
using SXICE.Core.Helpers;
using SXICE.Core.Domains;
using AutoMapper;
using SqlSugar;
using System.Linq;
using System.Collections.Generic;
using SXICE.Core.Models.Report;

namespace SXICE.WebAPI.Controllers
{
    /// <summary>
    /// 心理健康体检控制器
    /// </summary>
    [Route("")]
    [Authorize]
    public class PAController : ControllerBase
    {
        private readonly IPAService pAService;

        public PAController(IPAService pHService)
        {
            this.pAService = pHService;
        }

        /// <summary>
        /// 下一步
        /// </summary>
        /// <param name="choices">选项ID，以,分割，如：1,2,3</param>
        /// <param name="start">是否为开始</param>
        /// <returns>结果</returns>
        [HttpGet]
        public ReturnResult<ProgressItem> Next(string choices, bool start)
        {
            return pAService.Next(WorkContext.ToCustomer, start, choices?.ToIntArray());
        }

        /// <summary>
        /// 回退
        /// </summary>
        /// <returns>结果</returns>
        [HttpGet]
        public ReturnResult<ProgressItem> Back()
        {
            return pAService.Back(WorkContext.ToCustomer);
        }
    }
}